def findRestaurant(self, list1: List[str], list2: List[str]):
    #1.第一遍循环，给list1加入到字典中
    res = []
    dic = {}
    min_value = len(list1) + len(list2)
    for i in range(len(list1)):
        dic[list1[i]] = i
    for j in range(len(list2)):
        if list2[j] in dic:
            cur_value = j+dic[list2[j]]
            if cur_value<min_value:
                res = []
                res.append(cur_value)
            elif cur_value==min_value:
                res.append(cur_value)
    return res

if __name__ == '__main__':
    list1 = ["Shogun", "Tapioca Express", "Burger King", "KFC"]
    list2 = ["KFC", "Shogun", "Burger King"]
    res = findRestaurant(list1,list2)
    for x in res:
        print(x)